const Mock = require('mockjs')

const data = Mock.mock({
  'items|6': [{
    id: '@id',
    date: '@date',
    name: '@word(5, 10)',
    'type|1': ['el-icon-location-outline', 'el-icon-delete-location', 'el-icon-magic-stick', 'el-icon-location', 'el-icon-heavy-rain', 'el-icon-alarm-clock']
  }]
})
const materials = Mock.mock({
  'items|5': [{
    id: '@id',
    name: '@word(10, 20)',
    type: '@integer(1,3)',
    url: '@word(10,20)'
  }]
})

module.exports = [
  {
    url: '/vue-admin-template/project/milestones',
    type: 'get',
    response: config => {
      const items = data.items
      return {
        code: 20000,
        data: {
          total: items.length,
          items: items
        }
      }
    }
  },
  {
    url: '/vue-admin-template/project/materials',
    type: 'get',
    response: config => {
      const items = materials.items
      return {
        code: 20000,
        data: {
          total: items.length,
          items: items
        }
      }
    }
  }
]
